﻿@model IList<Products.Databases.Table>
@{
    ViewBag.Title = "Index";
    Layout = "../Shared/VersionPage.cshtml";
    var product = ViewData["Product"] as Products.Product;
}
@section buttons{
    @Html.ActionLink("Create Table", "Create", "Table", new { projectId = product.Id }, null)
}
<div class="cssform" style="width: 100%">
    <textarea style="width: 100%" readonly="readonly">
    @product.Memo
</textarea>
</div>
<div>
    @Html.Partial("../Shared/DisplayStateController")
    <table style="margin: 0 auto; width: 100%">
        <thead>
            <tr>
                <th>
                </th>
                <th>
                    Name
                </th>
                <th>
                    Concept Name
                </th>
                <th>
                    Memo
                </th>
                <th>
                    Current Version
                </th>
            </tr>
        </thead>
        <tbody class="DisplayState">
            @foreach (Products.Databases.Table t in this.Model)
            {
                <tr class="@t.DisplayState">
                    <td>
                        @Html.ActionLink("Details", "Details", "Table", new { area = "DataBase", name = t.ConceptName, version = t.SwitchedVersion.Name, product = t.Product.Name }, null)
                    </td>
                    <td>
                        @t.Name
                    </td>
                    <th>
                        @t.ConceptName
                    </th>
                    <td>
                        @this.Html.Raw(t.Memo)
                    </td>
                    <td>
                        @t.CurrentSnapshot.Version.Name
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>
@section Header{
    <script type="text/javascript">
        $(document).ready(function () {
            $(".buttonContainer a").button();
        });
        
    </script>
}
@section PageTitle{
    @product.Name
}
